package com.example.czxyproduct.web;

import com.example.czxyproduct.mapper.CategoryMapper;
import com.yc.czxy.bean.Category;
import com.yc.czxy.bean.Categorysecond;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: chengzixy
 * @description:
 * @author: 刘志成
 * @create: 2021-08-30 13:31
 */
@RestController
@RequestMapping("product")
public class CategoryAction {

    @Resource
    CategoryMapper categoryMapper;

    @RequestMapping("selectAllCategory")
    public List<Category> selectAllCategory() {
        List<Category> category = categoryMapper.selectAllCategory();
        return category;
    }
    @RequestMapping("selectCategorySecondBycid")
    public List<Categorysecond> selectCategorySecond(Integer cid) {
        List<Categorysecond> categorysecond = categoryMapper.selectCategorySecondBycid(cid);
        return categorysecond;
    }
}
